/**
 * 
 */
var MeController = function($scope, $http, $location, $log) {

	var data = $location.search().code;

	$scope.start = function() {
		if (data) {
			$http.get("../../weixin/openid?code=" + data).success(
					function(response) {
						if (response.code == 1) {
							$scope.openId = response.object;
						} else {
							alert(response.info);
							return;
						}

					});
		}
	}

	$scope.MyCard = function() {
		$location.path("myCard").search("code", $scope.openId);
	}

	$scope.MyComment = function() {
		$location.path("myComment").search("code", $scope.openId);
	}
	$scope.myInfo = function() {
		$location.path("intro").search("code", $scope.openId);
	}

	$scope.start();

}